<template>
  <div class="about">
    <h1>This is an about page</h1>
    <div id="mainContainer"></div>
  </div>
</template>

<script>
import { createMicroApp, unmountMicroApp } from '@ice/stark'

export default {
  data () {
    return {
      app: null
    }
  },
  mounted () {
    const appContainer = document.getElementById('mainContainer')

    this.app = createMicroApp({
      entry: '//localhost:8082/',
      name: 'app1',
      title: '通用页面',
      loadScriptMode: 'import',
      container: appContainer || undefined
    })
  },

  beforeDestroy () {
    unmountMicroApp('app1')
  }
}
</script>
